#include "ObserverBar.h"
#include <QDebug>

#include ".\UI\ModRun\Output\FactoryOutput.h"

ObserverBar::ObserverBar()
{
    QString strOutput = "ObserverBar 构造";
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }
}

ObserverBar::~ObserverBar()
{
    QString strOutput = "ObserverBar 析构";
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }
}


void ObserverBar::Update(QString strStatus)
{
    QString strOutput = "ObserverBar Update Status ：" + strStatus;
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }
}

QString ObserverBar::GetName()
{
    return "ObserverBar";
}
